/**
  ******************************************************************************
  * @文件名称 : disp_main.c
  * @摘要 : 
  * @创建日期 : Aug 1, 2024
  * @创建者：Mbl
  ******************************************************************************
  * @使用说明
  *
  *  
  ******************************************************************************
  */

/* 声明包含头文件 -----------------------------------------------------------*/
#include "../Inc/disp_main.h"
#include "../Inc/data_public.h"
/* 声明私有类型定义---------------------------------------------------------*/
LV_IMG_DECLARE(img_dsc);
/* 声明私有变量 -------------------------------------------------------------*/
static lv_obj_t* countDownBtn;  //倒计时按钮
static lv_obj_t* countDownLabel;  //倒计时按钮标签
static lv_obj_t* menuBtn;  //菜单界面切换按钮
static lv_obj_t* curveBtn;  //曲线界面切换按钮
static lv_obj_t* runBtn;  //运行确认界面切换按钮
static lv_obj_t* messBtn;  //消息界面切换按钮
static lv_obj_t* mainTempSetBtn;  //主温度设置按钮
static lv_obj_t* mainTempSetLabel;  //主温度设置标签
static lv_obj_t* rightValueBtn;  //右下设置值按钮
static lv_obj_t* rightValueLabel;  //右下显示值标签
static lv_obj_t* leftRightBtn;  //左下右下显示选择按钮
static lv_obj_t* switchCloseBtn;  //切换显示参数窗口关闭按钮
static lv_obj_t* runWinLabel;  //运行停止窗口标签
static lv_obj_t* runConfBtn;  //启停确认按钮
static lv_obj_t* runCancelBtn;  //启停取消按钮
static lv_obj_t* leftNullBtn;  //切换显示参数窗口左侧空按钮
static lv_obj_t* leftPfBtn;  //切换显示参数窗口左侧实测流量按钮
static lv_obj_t* leftPp1Btn;  //切换显示参数窗口左侧出液压力按钮
static lv_obj_t* leftPt2Btn;  //切换显示参数窗口左侧辅助温度按钮
static lv_obj_t* leftPt3Btn;  //切换显示参数窗口左侧环境温度按钮
static lv_obj_t* leftWqBtn;  //切换显示参数窗口左侧实测水质按钮
static lv_obj_t* rightNullBtn;  //切换显示参数窗口右侧空按钮
static lv_obj_t* rightPp2Btn;  //切换显示参数窗口右侧回液压力按钮
static lv_obj_t* rightPp1Btn;  //切换显示参数窗口右侧出液压力按钮
static lv_obj_t* rightPt2Btn;  //切换显示参数窗口右侧辅助温度按钮
static lv_obj_t* rightSfBtn;  //切换显示参数窗口右侧设定流量按钮
static lv_obj_t* rightSpBtn;  //切换显示参数窗口右侧设定压力按钮
//static lv_obj_t* runBtnLabel;  //运行、停止按钮标签
static lv_obj_t* messSumLabel;  //消息数量标签
static lv_obj_t* mainTempDisLabel;  //主温度显示标签
static lv_obj_t* mainTempDispUnitLabel;  //主温度显示单位标签
static lv_obj_t* mainTempSetUnitLabel;  //主温度设置单位标签
static lv_obj_t* clockLabel;  //时钟显示标签
static lv_obj_t* controlNumberLabel;  //程序控温序号标签
static lv_obj_t* leftValueLabel;  //左下显示值标签
static lv_obj_t* leftUnitLabel;  //左下显示单位标签
static lv_obj_t* leftIdLabel;  //左下显示标识标签
static lv_obj_t* rightUnitLabel;  //右下显示单位标签
static lv_obj_t* rightIdLabel;  //右下显示标识标签
static lv_obj_t* inOutLabel;  //内外循环切换标签
static uint8_t lastLeft;  //切换显示参数窗口左侧显示标志
static uint8_t lastRight;  //切换显示参数窗口右侧显示标志
//static lv_obj_t* run_img;	//报警液位标签
static lv_obj_t* luck_img;
static kb_userData_t  userData[3];

//static lv_obj_t* level_img;	//报警液位标签
//static lv_obj_t* pump_img;	//水泵启停标签
//static lv_obj_t* cool_img;	//制冷标签
//static lv_obj_t* hot_img;	//制热标签
//static lv_obj_t* comm_img;	//通讯标签
//static lv_obj_t* lock_img;	//锁屏标签
static uint8_t timecnt;

/* 声明私有常量 -------------------------------------------------------------*/

/* 声明私有宏定义 -----------------------------------------------------------*/

/* 声明私有函数 -------------------------------------------------------------*/


/**
  * @brief  主界面显示切换窗口左侧标签切换
  * @param  无
  * @retval 无
  */
void UI_main_left_label_switch(uint8_t left)
{
    lv_obj_add_style(leftNullBtn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空按钮为按钮样式4
    lv_obj_add_style(leftPfBtn,  &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧实测流量按钮为标签按钮4
    lv_obj_add_style(leftPp1Btn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧出液压力按钮为按钮样式4
    lv_obj_add_style(leftPt2Btn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧辅助温度按钮为按钮样式4
    lv_obj_add_style(leftPt3Btn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧环境温度按钮为按钮样式4
    lv_obj_add_style(leftWqBtn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧实测水质按钮为按钮样式4

    switch (left)
    {
    case 1:
        lv_obj_add_style(leftPfBtn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口左侧实测流量按钮为标签按钮3
        break;
    case 2:
        lv_obj_add_style(leftPp1Btn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口左侧出液压力按钮为按钮样式3
        break;
    case 3:
        lv_obj_add_style(leftPt2Btn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口左侧辅助温度按钮为按钮样式3
        break;
    case 4:
        lv_obj_add_style(leftPt3Btn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口左侧环境温度按钮为按钮样式3
        break;
    case 5:
        lv_obj_add_style(leftWqBtn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口左侧环境温度按钮为按钮样式3
        break;
    default:
        lv_obj_add_style(leftNullBtn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空按钮为按钮样式3
        break;
    }

    /* 保存屏幕参数 */
    if (g_RW_State == RW_READY)
    {
    	g_RW_State = RW_WRITE_NAND_SCREEN;
    }
}

/**
  * @brief  主界面显示切换窗口右侧标签切换
  * @param  无
  * @retval 无
  */
void UI_main_right_label_switch(uint8_t right)
{
    lv_obj_add_style(rightNullBtn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口右侧空按钮为按钮样式4
    lv_obj_add_style(rightPp2Btn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口右侧回液压力按钮为按钮样式4
    lv_obj_add_style(rightPp1Btn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口右侧出液压力按钮为按钮样式4
    lv_obj_add_style(rightPt2Btn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口右侧辅助温度按钮为按钮样式4
    lv_obj_add_style(rightSfBtn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口右侧设定流量按钮为按钮样式4
    lv_obj_add_style(rightSpBtn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口右侧设定压力按钮为按钮样式4

    switch (right)
    {
    case 1:
        lv_obj_add_style(rightPp2Btn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口右侧回液压力按钮为按钮样式3
        break;
    case 2:
        lv_obj_add_style(rightPp1Btn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口右侧出液压力按钮为按钮样式3
        break;
    case 3:
        lv_obj_add_style(rightPt2Btn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口右侧辅助温度按钮为按钮样式3
        break;
    case 4:
        lv_obj_add_style(rightSfBtn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口右侧设定流量按钮为按钮样式3
        break;
    case 5:
        lv_obj_add_style(rightSpBtn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口右侧设定压力按钮为按钮样式3
        break;
    default:
        lv_obj_add_style(rightNullBtn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口右侧空按钮为按钮样式3
        break;
    }

    /* 保存屏幕参数 */
    if (g_RW_State == RW_READY)
    {
    	g_RW_State = RW_WRITE_NAND_SCREEN;
    }
}

/**
* @brief 主界面按钮回调
* @param *e ：事件相关参数的集合，它包含了该事件的所有数据
* @return 无
*/
void UI_main_btn_event_cb(lv_event_t * e)
{
    lv_obj_t* target = lv_event_get_target(e); /* 获取触发源 */
    if(target == countDownBtn)  //倒计时按钮
    {
    	UP.compTime = FP.Time_RunDelayComp + 10;
    	send_aux(&UP.compTime);
    }
    else if (target == menuBtn)  //菜单界面切换按钮
    {
    	disp.Ret = DIF_MAIN;  //返回为主界面
    	disp.New = DIF_MENU;  //进入菜单界面
    }
    else if (target == curveBtn)  //曲线界面切换按钮
    {
    	disp.New = DIF_CURVE;
    }
    else if (target == runBtn)  //运行确认界面切换按钮
    {
    	UI_create_main_confirm_display();  //创建启停确认窗口
        if (UP.regAddr100.Para.Run_State == 0)
        {
        	lv_obj_clear_state(runBtn, LV_STATE_CHECKED);
            lv_label_set_text(runWinLabel, dispText[DA.typeLanguage].runText);  //文本内容
        }
        else
        {
        	lv_obj_add_state(runBtn, LV_STATE_CHECKED);
            lv_label_set_text(runWinLabel, dispText[DA.typeLanguage].stopText);  //文本内容
        }
        lv_label_set_recolor(runWinLabel, true);  //启用标签文本重新着色
    }
    else if (target == mainTempSetBtn)  //主温度设置按钮
    {
    	keyboard_create_float(5, 35, &userData[0]);//通过键盘设置主温度
    }
    else if (target == leftRightBtn)  //左下右下显示选择按钮
    {
    	UI_create_main_switch_display();  //创建切换显示窗口
        UI_main_left_label_switch(DA.leftValueFlag);  //切换显示标签
        UI_main_right_label_switch(DA.rightValueFlag);  //切换显示标签
    }
    else if (target == runConfBtn)  //启停确认按钮
    {
        if (UP.regAddr100.Para.Run_State == 0)
        {
        	UP.regAddr100.Para.Run_State = 1;
        	send_aux(&UP.regAddr100.rState_Chiller);
        }
        else
        {
        	UP.regAddr100.Para.Run_State = 0;
        	send_aux(&UP.regAddr100.rState_Chiller);
        }
        UI_delete_main_confirm_display();  //删除启停确认窗口
    }
    else if (target == runCancelBtn)  //启停取消标签
    {
    	UI_delete_main_confirm_display();  //删除启停确认窗口
    }
    else if (target == messBtn)  //消息界面切换按钮
    {
    	disp.New = DIF_MESS;
    }
    else if (target == switchCloseBtn)  //切换显示参数窗口关闭按钮
    {
    	UI_delete_main_switch_display();  //删除切换显示窗口
    }
    else if (target == leftNullBtn)  //切换显示参数窗口左侧空标签
    {
    	DA.leftValueFlag = 0;  //空
        UI_main_left_label_switch(DA.leftValueFlag);  //切换显示标签
    }
    else if (target == leftPfBtn)  //切换显示参数窗口左侧实测流量标签
    {
    	DA.leftValueFlag = 1;  //实测流量
        UI_main_left_label_switch(DA.leftValueFlag);  //切换显示标签
    }
    else if (target == leftPp1Btn)  //切换显示参数窗口左侧出液压力标签
    {
    	DA.leftValueFlag = 2;  //出液压力
        UI_main_left_label_switch(DA.leftValueFlag);  //切换显示标签
    }
    else if (target == leftPt2Btn)  //切换显示参数窗口左侧辅助温度标签
    {
    	DA.leftValueFlag = 3;  //辅助温度
        UI_main_left_label_switch(DA.leftValueFlag);  //切换显示标签
    }
    else if (target == leftPt3Btn)  //切换显示参数窗口左侧环境温度标签
    {
    	DA.leftValueFlag = 4;  //环境温度
        UI_main_left_label_switch(DA.leftValueFlag);  //切换显示标签
    }
    else if (target == leftWqBtn)  //切换显示参数窗口左侧实测水质标签
    {
    	DA.leftValueFlag = 5;  //实测水质
        UI_main_left_label_switch(DA.leftValueFlag);  //切换显示标签
    }
    else if (target == rightNullBtn)  //切换显示参数窗口右侧空标签
    {
        DA.rightValueFlag = 0;  //空
        UI_main_right_label_switch(DA.rightValueFlag);  //切换显示标签
    }
    else if (target == rightPp2Btn)  //切换显示参数窗口右侧回液压力标签
    {
    	DA.rightValueFlag = 1;  //回液压力
        UI_main_right_label_switch(DA.rightValueFlag);  //切换显示标签
    }
    else if (target == rightPp1Btn)  //切换显示参数窗口右侧出液压力标签
    {
    	DA.rightValueFlag = 2;  //出液压力
        UI_main_right_label_switch(DA.rightValueFlag);  //切换显示标签
    }
    else if (target == rightPt2Btn)  //切换显示参数窗口右侧辅助温度标签
    {
    	DA.rightValueFlag = 3;  //辅助温度
        UI_main_right_label_switch(DA.rightValueFlag);  //切换显示标签
    }
    else if (target == rightSfBtn)  //切换显示参数窗口右侧设定流量标签
    {
    	DA.rightValueFlag = 4;  //设定流量
        UI_main_right_label_switch(DA.rightValueFlag);  //切换显示标签
    }
    else if (target == rightSpBtn)  //切换显示参数窗口右侧设定压力标签
    {
    	DA.rightValueFlag = 5;  //设定压力
        UI_main_right_label_switch(DA.rightValueFlag);  //切换显示标签
    }
    else if (target == rightValueBtn)  //右下设置值按钮
    {
        if (DA.rightValueFlag == 4)  //设定流量
        {
        	keyboard_create_float(2, 16, &userData[1]);  //通过键盘设置流量
        }
        else if (DA.rightValueFlag == 5)  //设定压力
        {
        	keyboard_create_float(30, 500, &userData[2]);  //通过键盘设置压力
        }
    }
}

/**
  * @brief  显示界面定时器回调
  * @param  无
  * @retval 无
  */
void UI_main_timer_event_cb(lv_timer_t* timer)
{
	UI_display_main();  //主界面显示
	timecnt++;
//	if (timecnt == 100)
//	{
//		timecnt = 0;
//		__set_FAULTMASK(1);//禁止所有的可屏蔽中断
//		NVIC_SystemReset();//软件复位
//	}
}

/**
  * @brief  主界面创建
  * @param  无
  * @retval 无
  */
void UI_create_main(void)
{
	/* 键盘传入结构体初始化 */
	userData[0].value = &UP.SV_Temp1;
	userData[0].store_enable = 1;
	userData[1].value = &UP.SV_Flow;
	userData[1].store_enable = 1;
	userData[2].value = &UP.SV_Press;
	userData[2].store_enable = 1;
	lv_obj_t* label = NULL;  //显示标签

	/* 调整背光 */
	lcd_BackLight_adjust(DS.bringhtNess);

    parentObj = lv_img_create(lv_scr_act());
    lv_img_set_src(parentObj, &dsc_img_buff[1]);

//    parentObj = lv_obj_create(lv_scr_act());  //创建父对象
    lv_obj_add_style(parentObj, &style_parentObj, LV_STATE_DEFAULT);  //添加父对象为无填充样式
    lv_obj_set_size(parentObj, lv_pct(100), lv_pct(100));  //设置父对象的大小
    lv_obj_set_style_bg_color(parentObj,lv_palette_main(LV_PALETTE_GREEN),LV_STATE_DEFAULT);
    lv_obj_align(parentObj, LV_ALIGN_TOP_LEFT, 0, 0);  //设置父对象的位置

//    lv_obj_t * img = lv_img_create(parentObj);
//    lv_img_set_src(img, &dsc_img_buff[3]);
//    lv_obj_align(img, LV_ALIGN_CENTER, lv_pct(11), lv_pct(12));  //设置菜单图标对象的位置
    /* 定时器 */
	UI_display_timer = lv_timer_create(UI_main_timer_event_cb, 100, NULL);  //100mS触发一次

    /* 倒计时按钮 */
	countDownBtn = lv_btn_create(parentObj);  //创建倒计时按钮
    lv_obj_add_style(countDownBtn, &style_btn2, LV_STATE_DEFAULT);  //添加倒计时按钮为按钮样式2
    lv_obj_align_to(countDownBtn, parentObj, LV_ALIGN_TOP_LEFT, lv_pct(40), lv_pct(4));  //位置
    lv_obj_add_event_cb(countDownBtn, UI_main_btn_event_cb, LV_EVENT_LONG_PRESSED, NULL);  //事件
    lv_obj_add_flag(countDownBtn, LV_OBJ_FLAG_HIDDEN);  //隐藏右下显示单位标签
    /* 倒计时按钮标签 */
	countDownLabel = lv_label_create(countDownBtn);  //创建倒计时按钮标签
    lv_obj_set_style_text_color(countDownLabel,lv_color_hex(COLOUR_WIIP_BLUE),LV_STATE_DEFAULT);  //颜色
    lv_obj_align_to(countDownLabel, countDownBtn, LV_ALIGN_CENTER, 0, 0);  //位置

    /* 曲线界面切换按钮 */
    curveBtn = lv_btn_create(parentObj);  //创建曲线界面切换按钮
    lv_obj_add_style(curveBtn, &style_btn2, LV_STATE_DEFAULT);  //添加曲线界面切换按钮为按钮样式1
    lv_obj_set_style_width(curveBtn, lv_pct(32),LV_STATE_DEFAULT);  //宽
    lv_obj_align(curveBtn, LV_ALIGN_TOP_LEFT, lv_pct(30), lv_pct(5));  //位置
    lv_obj_add_event_cb(curveBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件

    lv_obj_t *img = lv_img_create(curveBtn);
    lv_img_set_src(img, &dsc_ico_buff[0]);
    lv_obj_align(img, LV_ALIGN_LEFT_MID, lv_pct(10), 0);  //设置菜单图标对象的位置
    /* 曲线按钮标签 */
    label = lv_label_create(curveBtn);  //创建曲线按钮标签
    lv_obj_set_style_text_color(label, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
    lv_label_set_text(label, dispText[DA.typeLanguage].curve);  //文本内容
    lv_obj_align_to(label, curveBtn, LV_ALIGN_CENTER, 0, 0);  //位置

    /* 菜单界面切换按钮 */
    menuBtn = lv_btn_create(parentObj);  //创建菜单界面切换按钮
    lv_obj_add_style(menuBtn, &style_btn2, LV_STATE_DEFAULT);  //添加菜单按钮为按钮样式1
    lv_obj_align(menuBtn, LV_ALIGN_TOP_LEFT, lv_pct(53), lv_pct(5));  //位置
    lv_obj_set_style_width(menuBtn, lv_pct(30),LV_STATE_DEFAULT);  //宽
    lv_obj_add_event_cb(menuBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    img = lv_img_create(menuBtn);
    lv_img_set_src(img, &dsc_ico_buff[1]);
    lv_obj_align(img, LV_ALIGN_LEFT_MID, lv_pct(10), 0);  //设置菜单图标对象的位置
    /* 菜单按钮标签 */
    label = lv_label_create(menuBtn);  //创建菜单按钮标签
    lv_obj_set_style_text_color(label, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
    lv_label_set_text(label, dispText[DA.typeLanguage].set);  //文本内容
    lv_obj_align_to(label, menuBtn, LV_ALIGN_CENTER, 0, 0);  //位置

	/* 消息界面切换按钮 */
	messBtn = lv_btn_create(parentObj);  //创建消息界面切换按钮
	lv_obj_add_style(messBtn, &style_btn2, LV_STATE_DEFAULT);  //添加消息界面切换按钮样式2
	lv_obj_align(messBtn, LV_ALIGN_TOP_LEFT, lv_pct(75), lv_pct(5));  //位置
	lv_obj_add_event_cb(messBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    img = lv_img_create(messBtn);
    lv_obj_set_style_width(messBtn, lv_pct(23),LV_STATE_DEFAULT);  //宽
    lv_img_set_src(img, &dsc_ico_buff[4]);
    lv_obj_align(img, LV_ALIGN_LEFT_MID, lv_pct(13), 0);  //设置菜单图标对象的位置
	/* 消息按钮标签 */
	label = lv_label_create(messBtn);  //创建消息按钮标签
	lv_obj_set_style_text_color(label, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
	lv_label_set_text(label, dispText[DA.typeLanguage].mess);  //文本内容
	lv_obj_align_to(label, messBtn, LV_ALIGN_RIGHT_MID, -20, 0);  //位置
	/* 消息数量标签 */
	messSumLabel = lv_label_create(messBtn);  //创建消息按钮标签
	lv_obj_add_style(messSumLabel, &style_label1, LV_STATE_DEFAULT);  //添加消息数量标签为标签样式1
	lv_obj_set_style_text_align(messSumLabel, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN);
	lv_obj_align_to(messSumLabel, messBtn, LV_ALIGN_TOP_LEFT, 125, 0);  //位置
	lv_obj_add_flag(messSumLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏右下显示单位标签

    /* 运行确认界面切换按钮 */
    runBtn = lv_btn_create(parentObj);  //创建运行确认界面切换按钮
    lv_obj_add_style(runBtn, &style_btn2, LV_STATE_DEFAULT);  //添加运行确认界面切换按钮样式1
//    lv_obj_set_style_width(runBtn, lv_pct(25),LV_STATE_DEFAULT);  //宽
//    lv_obj_set_style_height(runBtn, lv_pct(45),LV_STATE_DEFAULT);  //高
    lv_obj_set_size(runBtn, 123, 183);
    lv_obj_align(runBtn, LV_ALIGN_TOP_LEFT, lv_pct(5), lv_pct(50));  //位置
    lv_obj_add_event_cb(runBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
	lv_obj_set_style_bg_img_src(runBtn, &dsc_ico_buff[7], LV_STATE_DEFAULT);
	lv_obj_set_style_bg_img_src(runBtn, &dsc_ico_buff[8], LV_STATE_CHECKED);
//    run_img = lv_img_create(runBtn);
//    lv_img_set_src(run_img, &dsc_ico_buff[7]);
//    lv_obj_align(run_img, LV_ALIGN_TOP_MID, 0, 0);  //设置菜单图标对象的位置
    /* 运行、停止按钮标签 */
//    runBtnLabel = lv_label_create(runBtn);  //创建运行、停止按钮标签
//    lv_obj_align_to(runBtnLabel, runBtn, LV_ALIGN_BOTTOM_MID, 0, 0);  //位置

    /* 主温度显示标签 */
    mainTempDisLabel = lv_label_create(parentObj);  //创建主温度显示标签
    lv_obj_align_to(mainTempDisLabel, parentObj, LV_ALIGN_TOP_LEFT, lv_pct(60), lv_pct(31));  //位置
    lv_obj_set_style_text_font(mainTempDisLabel, &daojin100, LV_STATE_DEFAULT);
    /* 主温度显示单位标签 */
    mainTempDispUnitLabel = lv_label_create(parentObj);  //创建消息按钮标签
    lv_obj_set_style_text_font(mainTempDispUnitLabel, &daojin36, LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(mainTempDispUnitLabel, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
    lv_obj_align(mainTempDispUnitLabel, LV_ALIGN_TOP_LEFT, lv_pct(88), lv_pct(31));  //位置
    /* 主温度PV标签 */
    label = lv_label_create(parentObj);  //创建消息按钮标签
    lv_label_set_text(label, "PV");  //文本内容
    lv_obj_set_style_text_font(label, &daojin36, LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(label, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
    lv_obj_align_to(label, parentObj, LV_ALIGN_TOP_LEFT, lv_pct(88), lv_pct(47));  //位置

    img = lv_img_create(parentObj);
    lv_img_set_zoom(img, 200);
    lv_img_set_src(img, &dsc_ico_buff[12]);
    lv_obj_align(img, LV_ALIGN_TOP_LEFT,lv_pct(32), lv_pct(23));  //设置菜单图标对象的位置
    /* 主温度设置按钮 */
    mainTempSetBtn = lv_btn_create(parentObj);  //主温度设置按钮
    lv_obj_add_style(mainTempSetBtn, &style_btn2, LV_STATE_DEFAULT);  //添加主温度设置按钮样式2
    lv_obj_set_style_height(mainTempSetBtn, lv_pct(20),LV_STATE_DEFAULT);  //高
    lv_obj_set_style_width(mainTempSetBtn, lv_pct(25), LV_STATE_DEFAULT);
    lv_obj_align(mainTempSetBtn, LV_ALIGN_TOP_LEFT, lv_pct(30), lv_pct(50));  //位置
    lv_obj_add_event_cb(mainTempSetBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 主温度设置标签 */
    mainTempSetLabel = lv_label_create(mainTempSetBtn);  //主温度设置标签
    lv_obj_align_to(mainTempSetLabel, mainTempSetBtn, LV_ALIGN_TOP_LEFT, -10, -20);  //位置
    lv_obj_set_style_text_font(mainTempSetLabel, &daojin50, LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(mainTempSetLabel, lv_color_hex(0x00e4ff), LV_STATE_DEFAULT);
    lv_label_set_text_fmt(mainTempSetLabel, "%.1f", UP.SV_Temp1);  //更新主温度设定值
    /* 主温度设置单位标签 */
    mainTempSetUnitLabel = lv_label_create(parentObj);  //创建消息按钮标签
    lv_obj_set_style_text_color(mainTempSetUnitLabel, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
    lv_obj_align_to(mainTempSetUnitLabel, parentObj, LV_ALIGN_TOP_LEFT, lv_pct(50), lv_pct(49));  //位置
    /* 主温度SV标签 */
    label = lv_label_create(parentObj);  //创建消息按钮标签
    lv_obj_set_style_text_color(label, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
    lv_obj_align_to(label, parentObj, LV_ALIGN_TOP_LEFT, lv_pct(50), lv_pct(61));  //位置
    lv_label_set_text(label, "SV");  //文本内容

    /* 时钟显示标签 */
    clockLabel = lv_label_create(parentObj);  //创建时钟显示标签
    lv_obj_set_style_text_color(clockLabel, lv_color_hex(0xC9C9C9), LV_STATE_DEFAULT);
    lv_obj_set_style_text_letter_space(clockLabel, 2, LV_STATE_DEFAULT);
    lv_obj_set_style_text_line_space(clockLabel, 4, LV_STATE_DEFAULT);  // 设置行间距为10像素
    lv_obj_align_to(clockLabel, parentObj, LV_ALIGN_TOP_LEFT, lv_pct(4), lv_pct(27));  //位置
//    lv_obj_set_style_text_color(clockLabel, lv_color_hex(0xffffff), LV_STATE_DEFAULT);
    lv_label_set_text_fmt(clockLabel, "20%02d-%02d-%02d\n%02d:%02d:%02d", DS.clockTime.year,DS.clockTime.month,DS.clockTime.day,DS.clockTime.hour,DS.clockTime.min,DS.clockTime.sec);  //更新时钟显示

    /* 程序控温序号标签 */
    controlNumberLabel = lv_label_create(parentObj);  //创建程序控温序号标签
    lv_obj_align_to(controlNumberLabel, parentObj, LV_ALIGN_TOP_LEFT, lv_pct(5), lv_pct(70));  //位置
    lv_obj_set_style_text_color(controlNumberLabel,lv_color_hex(0xc9c9c9),LV_STATE_DEFAULT);  //颜色
    lv_obj_add_flag(controlNumberLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏程序控温序号标签

    /* 左下显示值标签 */
    leftValueLabel = lv_label_create(parentObj);  //创建左下显示值标签
    lv_obj_set_style_text_color(leftValueLabel, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
    lv_obj_align(leftValueLabel, LV_ALIGN_TOP_LEFT, lv_pct(50), lv_pct(80));  //位置
    lv_obj_add_flag(leftValueLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏左下显示值
    /* 左下显示单位标签 */
    leftUnitLabel = lv_label_create(parentObj);  //创建左下显示单位标签
    lv_obj_set_style_text_color(leftUnitLabel, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
    lv_obj_align(leftUnitLabel, LV_ALIGN_TOP_LEFT, lv_pct(60), lv_pct(75));  //位置
    lv_obj_add_flag(leftUnitLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏左下显示单位标签
    /* 左下显示标识标签 */
    leftIdLabel = lv_label_create(parentObj);  //创建左下显示标识标签
    lv_obj_set_style_text_color(leftIdLabel, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
    lv_obj_align(leftIdLabel, LV_ALIGN_TOP_LEFT, lv_pct(60), lv_pct(85));  //位置
    lv_obj_add_flag(leftIdLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏左下显示标识标签
    /* 右下显示值标签 */
    rightValueLabel = lv_label_create(parentObj);  //创建右下显示值标签
    lv_obj_set_style_text_color(rightValueLabel, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
    lv_obj_align(rightValueLabel, LV_ALIGN_TOP_LEFT, lv_pct(75), lv_pct(80));  //位置
    lv_obj_add_flag(rightValueLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏右下显示值按钮
    /* 右下设置值按钮 */
    rightValueBtn = lv_btn_create(rightValueLabel);  //创建右下设置值按钮
    lv_obj_align_to(rightValueBtn, rightValueLabel, LV_ALIGN_CENTER, 0, 0);  //位置
    lv_obj_add_style(rightValueBtn, &style_btn2, LV_STATE_DEFAULT);  //添加右下设置值按钮样式2
    lv_obj_add_event_cb(rightValueBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);
    /* 右下显示单位标签 */
    rightUnitLabel = lv_label_create(parentObj);  //创建右下显示单位标签
    lv_obj_set_style_text_color(rightUnitLabel, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
    lv_obj_align(rightUnitLabel, LV_ALIGN_TOP_LEFT, lv_pct(85), lv_pct(75));  //位置
    lv_obj_add_flag(rightUnitLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏右下显示单位标签
    /* 右下显示标识标签 */
    rightIdLabel = lv_label_create(parentObj);  //创建右下显示标识标签
    lv_obj_set_style_text_color(rightIdLabel, lv_color_hex(0xc9c9c9), LV_STATE_DEFAULT);
    lv_obj_align(rightIdLabel, LV_ALIGN_TOP_LEFT, lv_pct(85), lv_pct(85));  //位置
    lv_obj_add_flag(rightIdLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏右下显示标识标签
    /* 内外循环标签 */
    inOutLabel = lv_label_create(parentObj);  //创建内外循环标签
    lv_obj_set_style_text_font(inOutLabel, &lv_font_montserrat_20, LV_STATE_DEFAULT);
    lv_obj_align(inOutLabel, LV_ALIGN_TOP_LEFT, lv_pct(5), lv_pct(90));  //位置
    lv_obj_add_flag(inOutLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏内外循环标签

    /* 左下右下显示选择按钮 */
    leftRightBtn = lv_btn_create(parentObj);  //创建左下右下显示选择按钮
    lv_obj_align(leftRightBtn, LV_ALIGN_TOP_LEFT, lv_pct(30), lv_pct(74));  //位置
    lv_obj_set_style_bg_opa(leftRightBtn, LV_OPA_TRANSP, LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_opa(leftRightBtn, LV_OPA_TRANSP, LV_STATE_DEFAULT);  //设置阴影透明度
    lv_obj_add_state(leftRightBtn, LV_STATE_DISABLED);
    lv_obj_add_event_cb(leftRightBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 按钮禁止点击，仅显示出液压力 */
	DA.leftValueFlag = 2;  //出液压力
//    UI_main_left_label_switch(DA.leftValueFlag);  //切换显示标签
    /* 设置图片源 */
    img = lv_img_create(leftRightBtn);
    lv_img_set_src(img, &dsc_ico_buff[13]);
    lv_obj_align(img, LV_ALIGN_TOP_MID, 0, 0);  //设置菜单图标对象的位置
//    /* 左下右下显示选择图标标签 */
//    label = lv_label_create(leftRightBtn);  //创建左下右下显示选择图标标签
//    lv_label_set_text(label, LV_SYMBOL_EYE_OPEN);  //文本内容
//    lv_obj_set_style_text_font(label, &lv_font_montserrat_20, LV_STATE_DEFAULT);
//    lv_obj_align_to(label, leftRightBtn, LV_ALIGN_TOP_LEFT, 0, 0);  //位置
}

/**
  * @brief  主界面删除
  * @param  无
  * @retval 无
  */
void UI_delete_main(void)
{
	lv_obj_del(parentObj);  //删除当前界面
	lv_timer_del(UI_display_timer);  //删除定时器
	lastLeft = 0;
	lastRight = 0;
}

/**
  * @brief  切换显示界面创建
  * @param  无
  * @retval 无
  */
void UI_create_main_switch_display(void)
{
	lv_obj_t* label = NULL;  //显示标签

	/* 切换显示参数窗口父对象 */
    parentObj1 = lv_obj_create(parentObj);  //创建父对象
    lv_obj_add_style(parentObj1, &style_parentObj1, LV_STATE_DEFAULT);  //添加父对象为无填充样式
    lv_obj_set_size(parentObj1, lv_pct(88), lv_pct(83));  //设置父对象的大小
    lv_obj_set_style_bg_color(parentObj1, lv_color_hex(0x303236), 0);  //背景颜色
    lv_obj_set_style_border_color(parentObj1, lv_color_hex(0x3b4048), 0);  //边框颜色
    lv_obj_set_style_align(parentObj1, LV_ALIGN_CENTER, LV_STATE_DEFAULT); //设置父对象的位置

    /* 切换显示参数窗口标签 */
    label = lv_label_create(parentObj1);  //创建菜单按钮标签
    lv_label_set_text(label, dispText[DA.typeLanguage].switchText);  //文本内容
    lv_obj_set_style_text_color(label, lv_color_hex(0xffffff), LV_STATE_DEFAULT);
    lv_obj_align_to(label, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(7), lv_pct(5));  //位置
    /* 切换显示参数窗口左侧标签 */
    label = lv_label_create(parentObj1);  //切换显示参数窗口左侧标签
    lv_label_set_text(label, dispText[DA.typeLanguage].left);  //文本内容
    lv_obj_set_style_text_color(label, lv_color_hex(0xffffff), LV_STATE_DEFAULT);
    lv_obj_align_to(label, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(7), lv_pct(21));  //位置
    /* 切换显示参数窗口右侧标签 */
    label = lv_label_create(parentObj1);  //切换显示参数窗口右侧标签
    lv_label_set_text(label, dispText[DA.typeLanguage].right);  //文本内容
    lv_obj_set_style_text_color(label, lv_color_hex(0xffffff), LV_STATE_DEFAULT);
    lv_obj_align_to(label, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(7), lv_pct(54));  //位置
    /* 切换显示参数窗口关闭按钮 */
    switchCloseBtn = lv_btn_create(parentObj1);  //切换显示参数窗口关闭按钮
    lv_obj_align_to(switchCloseBtn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(90), lv_pct(2));  //位置
    lv_obj_add_event_cb(switchCloseBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口关闭标签 */
    label = lv_label_create(switchCloseBtn);  //切换显示参数窗口关闭标签
    lv_obj_align_to(label, switchCloseBtn, LV_ALIGN_TOP_RIGHT, 0, 0);  //位置
    lv_label_set_text(label, LV_SYMBOL_CLOSE);  //文本内容
    /* 切换显示参数窗口左侧空按钮 */
    leftNullBtn = lv_btn_create(parentObj1);  //切换显示参数窗口左侧空按钮
    lv_obj_add_style(leftNullBtn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为按钮样式3
    lv_obj_align_to(leftNullBtn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(19), lv_pct(17));  //位置
    lv_obj_add_event_cb(leftNullBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口左侧空标签 */
    label = lv_label_create(leftNullBtn);  //切换显示参数窗口左侧空标签
    lv_obj_add_style(label, &style_label2, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为标签样式2
    lv_label_set_text(label, dispText[DA.typeLanguage].null);  //文本内容
    lv_obj_align_to(label, leftNullBtn, LV_ALIGN_CENTER, 0, 0);  //位置
    /* 切换显示参数窗口左侧实测流量按钮 */
    leftPfBtn = lv_btn_create(parentObj1);  //切换显示参数窗口左侧实测流量按钮
    lv_obj_add_style(leftPfBtn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为按钮样式3
    lv_obj_align_to(leftPfBtn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(40), lv_pct(17));  //位置
    lv_obj_add_event_cb(leftPfBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口左侧实测流量标签 */
    label = lv_label_create(leftPfBtn);  //切换显示参数窗口左侧实测流量标签
    lv_obj_add_style(label, &style_label2, LV_STATE_DEFAULT);  //添加显示参数窗口左侧实测流量标签为标签样式3
    lv_label_set_text(label, dispText[DA.typeLanguage].PV_F);  //文本内容
    lv_obj_align_to(label, leftPfBtn, LV_ALIGN_CENTER, 0, 0);  //位置
    /* 切换显示参数窗口左侧出液压力按钮 */
    leftPp1Btn = lv_btn_create(parentObj1);  //切换显示参数窗口左侧出液压力按钮
    lv_obj_add_style(leftPp1Btn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为按钮样式3
    lv_obj_align_to(leftPp1Btn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(61), lv_pct(17));  //位置
    lv_obj_add_event_cb(leftPp1Btn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口左侧出液压力标签 */
    label = lv_label_create(leftPp1Btn);  //切换显示参数窗口左侧出液压力标签
    lv_obj_add_style(label, &style_label2, LV_STATE_DEFAULT);  //添加显示参数窗口左侧出液压力标签为标签样式3
    lv_label_set_text(label, dispText[DA.typeLanguage].PV_P1);  //文本内容
    lv_obj_align_to(label, leftPp1Btn, LV_ALIGN_CENTER, 0, 0);  //位置
    /* 切换显示参数窗口左侧辅助温度按钮 */
    leftPt2Btn = lv_btn_create(parentObj1);  //切换显示参数窗口左侧辅助温度按钮
    lv_obj_add_style(leftPt2Btn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为按钮样式3
    lv_obj_align_to(leftPt2Btn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(19), lv_pct(33));  //位置
    lv_obj_add_event_cb(leftPt2Btn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口左侧辅助温度标签 */
    label = lv_label_create(leftPt2Btn);  //切换显示参数窗口左侧辅助温度标签
    lv_obj_add_style(label, &style_label2, LV_STATE_DEFAULT);  //添加显示参数窗口左侧辅助温度标签为标签样式3
    lv_label_set_text(label, dispText[DA.typeLanguage].PV_T2);  //文本内容
    lv_obj_align_to(label, leftPt2Btn, LV_ALIGN_CENTER, 0, 0);  //位置
    /* 切换显示参数窗口左侧环境温度按钮 */
    leftPt3Btn = lv_btn_create(parentObj1);  //切换显示参数窗口左侧环境温度按钮
    lv_obj_add_style(leftPt3Btn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为按钮样式3
    lv_obj_align_to(leftPt3Btn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(40), lv_pct(33));  //位置
    lv_obj_add_event_cb(leftPt3Btn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口左侧环境温度标签 */
    label = lv_label_create(leftPt3Btn);  //切换显示参数窗口左侧环境温度标签
    lv_obj_add_style(label, &style_label2, LV_STATE_DEFAULT);  //添加显示参数窗口左侧环境温度标签为标签样式3
    lv_label_set_text(label, dispText[DA.typeLanguage].PV_T3);  //文本内容
    lv_obj_align_to(label, leftPt3Btn, LV_ALIGN_CENTER, 0, 0);  //位置
    /* 切换显示参数窗口左侧环境温度按钮 */
    leftWqBtn = lv_btn_create(parentObj1);  //切换显示参数窗口左侧环境温度按钮
    lv_obj_add_style(leftWqBtn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为按钮样式3
    lv_obj_align_to(leftWqBtn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(61), lv_pct(33));  //位置
    lv_obj_add_event_cb(leftWqBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口左侧环境温度标签 */
    label = lv_label_create(leftWqBtn);  //切换显示参数窗口左侧环境温度标签
    lv_obj_add_style(label, &style_label2, LV_STATE_DEFAULT);  //添加显示参数窗口左侧环境温度标签为标签样式3
    lv_label_set_text(label, dispText[DA.typeLanguage].PV_WQ);  //文本内容
    lv_obj_align_to(label, leftWqBtn, LV_ALIGN_CENTER, 0, 0);  //位置
    /* 切换显示参数窗口右侧空按钮 */
    rightNullBtn = lv_btn_create(parentObj1);  //切换显示参数窗口右侧空按钮
    lv_obj_add_style(rightNullBtn, &style_btn3, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为按钮样式3
    lv_obj_align_to(rightNullBtn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(19), lv_pct(50));  //位置
    lv_obj_add_event_cb(rightNullBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口右侧空标签 */
    label = lv_label_create(rightNullBtn);  //切换显示参数窗口右侧空标签
    lv_obj_add_style(label, &style_label2, LV_STATE_DEFAULT);  //添加显示参数窗口右侧空标签为标签样式2
    lv_label_set_text(label, dispText[DA.typeLanguage].null);  //文本内容
    lv_obj_align_to(label, rightNullBtn, LV_ALIGN_CENTER, 0, 0);  //位置
    /* 切换显示参数窗口右侧回液压力按钮 */
    rightPp2Btn = lv_btn_create(parentObj1);  //切换显示参数窗口右侧回液压力按钮
    lv_obj_add_style(rightPp2Btn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为按钮样式3
    lv_obj_align_to(rightPp2Btn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(40), lv_pct(50));  //位置
    lv_obj_add_event_cb(rightPp2Btn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口右侧回液压力标签 */
    label = lv_label_create(rightPp2Btn);  //切换显示参数窗口右侧回液压力标签
    lv_obj_add_style(label, &style_label2, LV_STATE_DEFAULT);  //添加显示参数窗口右侧回液压力标签为标签样式3
    lv_label_set_text(label, dispText[DA.typeLanguage].PV_P2);  //文本内容
    lv_obj_align_to(label, rightPp2Btn, LV_ALIGN_CENTER, 0, 0);  //位置
    /* 切换显示参数窗口右侧回液压力按钮 */
    rightPp1Btn = lv_btn_create(parentObj1);  //切换显示参数窗口右侧回液压力按钮
    lv_obj_add_style(rightPp1Btn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为按钮样式3
    lv_obj_align_to(rightPp1Btn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(61), lv_pct(50));  //位置
    lv_obj_add_event_cb(rightPp1Btn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口右侧出液压力标签 */
    label = lv_label_create(rightPp1Btn);  //切换显示参数窗口右侧出液压力标签
    lv_obj_add_style(label, &style_label2, LV_STATE_DEFAULT);  //添加显示参数窗口右侧出液压力标签为标签样式3
    lv_label_set_text(label, dispText[DA.typeLanguage].PV_P1);  //文本内容
    lv_obj_align_to(label, rightPp1Btn, LV_ALIGN_CENTER, 0, 0);  //位置
    /* 切换显示参数窗口右侧辅助温度按钮 */
    rightPt2Btn = lv_btn_create(parentObj1);  //切换显示参数窗口右侧辅助温度按钮
    lv_obj_add_style(rightPt2Btn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为按钮样式3
    lv_obj_align_to(rightPt2Btn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(19), lv_pct(66));  //位置
    lv_obj_add_event_cb(rightPt2Btn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口右侧辅助温度标签 */
    label = lv_label_create(rightPt2Btn);  //切换显示参数窗口左侧辅助温度标签
    lv_obj_add_style(label, &style_label2, LV_STATE_DEFAULT);  //添加显示参数窗口左侧辅助温度标签为标签样式3
    lv_label_set_text(label, dispText[DA.typeLanguage].PV_T2);  //文本内容
    lv_obj_align_to(label, rightPt2Btn, LV_ALIGN_CENTER, 0, 0);  //位置
    /* 切换显示参数窗口右侧设定流量按钮 */
    rightSfBtn = lv_btn_create(parentObj1);  //切换显示参数窗口右侧设定流量按钮
    lv_obj_add_style(rightSfBtn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为按钮样式3
    lv_obj_align_to(rightSfBtn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(40), lv_pct(66));  //位置
    lv_obj_add_event_cb(rightSfBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口右侧设定流量标签 */
    label = lv_label_create(rightSfBtn);  //切换显示参数窗口右侧设定流量标签
    lv_obj_add_style(label, &style_label2, LV_STATE_DEFAULT);  //添加显示参数窗口右侧设定流量标签为标签样式3
    lv_label_set_text(label, dispText[DA.typeLanguage].SV_F);  //文本内容
    lv_obj_align_to(label, rightSfBtn, LV_ALIGN_CENTER, 0, 0);  //位置
    /* 切换显示参数窗口右侧设定压力按钮 */
    rightSpBtn = lv_btn_create(parentObj1);  //切换显示参数窗口右侧设定流量按钮
    lv_obj_add_style(rightSpBtn, &style_btn4, LV_STATE_DEFAULT);  //添加显示参数窗口左侧空标签为按钮样式3
    lv_obj_align_to(rightSpBtn, parentObj1, LV_ALIGN_TOP_LEFT, lv_pct(61), lv_pct(66));  //位置
    lv_obj_add_event_cb(rightSpBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 切换显示参数窗口右侧设定压力标签 */
    label = lv_label_create(rightSpBtn);  //切换显示参数窗口右侧设定压力标签
    lv_obj_add_style(label, &style_label2, LV_STATE_DEFAULT);  //添加显示参数窗口右侧设定压力标签为标签样式3
    lv_label_set_text(label, dispText[DA.typeLanguage].SV_P1);  //文本内容
    lv_obj_align_to(label, rightSpBtn, LV_ALIGN_CENTER, 0, 0);  //位置
}

/**
  * @brief  切换显示界面删除
  * @param  无
  * @retval 无
  */
void UI_delete_main_switch_display(void)
{
	lv_obj_del(parentObj1);  //删除当前界面
}

/**
  * @brief  启停确认界面创建
  * @param  无
  * @retval 无
  */
void UI_create_main_confirm_display(void)
{
	lv_obj_t* label = NULL;  //显示标签

    /* 运行停止显示窗口对象 */
    parentObj2 = lv_obj_create(parentObj);  //创建父对象
    lv_obj_add_style(parentObj2, &style_parentObj1, LV_STATE_DEFAULT);  //添加父对象为无填充样式
    lv_obj_set_size(parentObj2, lv_pct(65), lv_pct(53));  //设置父对象的大小
    lv_obj_set_style_bg_color(parentObj2, lv_color_hex(0x303236), 0);  //背景颜色
    lv_obj_set_style_border_color(parentObj2, lv_color_hex(0x3b4048), 0);  //边框颜色
    lv_obj_set_style_align(parentObj2, LV_ALIGN_CENTER, LV_STATE_DEFAULT);  //设置父对象的位置

    parentObj3 = lv_obj_create(parentObj2);  //创建父对象
    lv_obj_add_style(parentObj3, &style_parentObj1, LV_STATE_DEFAULT);  //添加父对象为无填充样式
    lv_obj_set_size(parentObj3, lv_pct(90), lv_pct(50));  //设置父对象的大小
    lv_obj_set_style_bg_color(parentObj3, lv_color_hex(0x3b4048), 0);  //背景颜色
    lv_obj_set_style_border_color(parentObj3, lv_color_hex(0x3b4048), 0);  //边框颜色
    lv_obj_align(parentObj3, LV_ALIGN_TOP_LEFT, lv_pct(5), lv_pct(15));  //位置

    /* 运行停止窗口标签 */
    runWinLabel = lv_label_create(parentObj3);  //创建运行窗口标签
    lv_obj_set_style_align(runWinLabel, LV_ALIGN_CENTER, LV_STATE_DEFAULT);  //设置父对象的位置

    /* 启停确认按钮 */
    runConfBtn = lv_btn_create(parentObj2);  //创建运行窗口运行按钮
    lv_obj_set_style_shadow_opa(runConfBtn, LV_OPA_0, LV_STATE_DEFAULT);  //阴影
    lv_obj_align_to(runConfBtn, parentObj2, LV_ALIGN_TOP_LEFT, lv_pct(20), lv_pct(70));  //位置
    lv_obj_add_event_cb(runConfBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 启停取消按钮 */
    runCancelBtn = lv_btn_create(parentObj2);  //创建运行窗口取消按钮
    lv_obj_set_style_shadow_opa(runCancelBtn, LV_OPA_0, LV_STATE_DEFAULT);  //阴影
    lv_obj_align_to(runCancelBtn, parentObj2, LV_ALIGN_TOP_LEFT, lv_pct(60), lv_pct(70));  //位置
    lv_obj_set_style_bg_color(runCancelBtn, lv_color_hex(0x202020), LV_STATE_DEFAULT); //设置对象背景颜色
    lv_obj_add_event_cb(runCancelBtn, UI_main_btn_event_cb, LV_EVENT_CLICKED, NULL);  //事件
    /* 启停确认标签 */
    label = lv_label_create(runConfBtn);  //创建运行窗口标签
    lv_obj_align_to(label, runConfBtn, LV_ALIGN_TOP_LEFT, 0, 0);  //位置
    lv_obj_set_style_text_color(label,lv_color_hex(0xFFFFFF),LV_STATE_DEFAULT);  //颜色
    lv_label_set_text(label, dispText[DA.typeLanguage].confirm);  //文本内容
    lv_label_set_recolor(label, true);  //启用标签文本重新着色
    /* 启停取消标签 */
    label = lv_label_create(runCancelBtn);  //创建运行窗口标签
    lv_obj_align_to(label, runCancelBtn, LV_ALIGN_TOP_LEFT, 0, 0);  //位置
    lv_obj_set_style_text_color(label,lv_color_hex(0xFFFFFF),LV_STATE_DEFAULT);  //颜色
    lv_label_set_text(label, dispText[DA.typeLanguage].cancel);  //文本内容
    lv_label_set_recolor(label, true);  //启用标签文本重新着色

	luck_img = lv_img_create(parentObj);
    lv_img_set_src(luck_img, &dsc_ico_buff[14]);
    lv_img_set_zoom(luck_img, 170);
    lv_obj_add_style(luck_img, &style_parentObj, LV_STATE_DEFAULT);  //添加父对象为无填充样式
//    lv_obj_set_size(img, lv_pct(100), lv_pct(100));  //设置父对象的大小
    lv_obj_align(luck_img, LV_ALIGN_TOP_LEFT, lv_pct(72), lv_pct(53));  //设置父对象的位置
}

/**
  * @brief  启停确认界面删除
  * @param  无
  * @retval 无
  */
void UI_delete_main_confirm_display(void)
{
	lv_obj_del(parentObj2);  //删除当前界面
	lv_obj_del(luck_img);	 //删除吉祥物
}

/**
  * @brief  主界面显示
  * @param  无
  * @retval 无
  */
void UI_display_main(void)
{
    lv_label_set_text_fmt(mainTempSetLabel, "%.1f", UP.SV_Temp1);  //更新主温度
    lv_label_set_text_fmt(clockLabel, "20%02d-%02d-%02d\n%02d:%02d:%02d", DS.clockTime.year,DS.clockTime.month,DS.clockTime.day,DS.clockTime.hour,DS.clockTime.min,DS.clockTime.sec);  //更新时钟显示
//    /* 图标显示 */
//    if (UP.gState_Level == 1)  // 液位
//    {
//        lv_img_set_src(level_img, &ico_buff[19]);
//        lv_obj_clear_flag(level_img, LV_OBJ_FLAG_HIDDEN);
//    }
//    else if (UP.gState_Level == 2)
//    {
//        lv_img_set_src(level_img, &ico_buff[23]);
//        lv_obj_clear_flag(level_img, LV_OBJ_FLAG_HIDDEN);
//    }
//    else if (UP.gState_Level == 3)
//    {
//        lv_img_set_src(level_img, &ico_buff[21]);
//        lv_obj_clear_flag(level_img, LV_OBJ_FLAG_HIDDEN);
//    }
//    else if (UP.gState_Level == 4)
//    {
//        lv_img_set_src(level_img, &ico_buff[8]);
//        lv_obj_clear_flag(level_img, LV_OBJ_FLAG_HIDDEN);
//    }
//    else
//    {
//    	lv_obj_add_flag(level_img, LV_OBJ_FLAG_HIDDEN);
//    }
//    if (UP.regAddr100.Para.LastState_Pump == 1)  // 水泵
//    {
//    	lv_obj_clear_flag(pump_img, LV_OBJ_FLAG_HIDDEN);
//    }
//    else
//    {
//    	lv_obj_add_flag(pump_img, LV_OBJ_FLAG_HIDDEN);
//    }
//    if (UP.regAddr100.Para.LastState_Heater == 1)		// 制冷
//    {
//    	lv_obj_clear_flag(hot_img, LV_OBJ_FLAG_HIDDEN);
//    }
//    else
//    {
//    	lv_obj_add_flag(hot_img, LV_OBJ_FLAG_HIDDEN);
//    }
//    if (UP.regAddr100.Para.EQUWaterin == 1)   // 加热
//    {
//    	lv_obj_clear_flag(comm_img, LV_OBJ_FLAG_HIDDEN);
//    }
//    else
//    {
//    	lv_obj_add_flag(comm_img, LV_OBJ_FLAG_HIDDEN);
//    }
//    if (DA.lockModeFlag == 1)
//    {
//    	lv_obj_clear_flag(lock_img, LV_OBJ_FLAG_HIDDEN);
//    }
//    else
//    {
//    	lv_obj_add_flag(lock_img, LV_OBJ_FLAG_HIDDEN);
//    }
    /* 倒计时显示 */
    if(UP.compTime == 0)
    {
    	if(lv_obj_has_flag(countDownBtn, LV_OBJ_FLAG_HIDDEN) == false)  //没有隐藏
    	{
    		lv_obj_add_flag(countDownBtn, LV_OBJ_FLAG_HIDDEN);  //隐藏倒计时按钮
    	}
    }
    else
    {
    	if(lv_obj_has_flag(countDownBtn, LV_OBJ_FLAG_HIDDEN) == true)  //没有显示
    	{
    		lv_obj_clear_flag(countDownBtn, LV_OBJ_FLAG_HIDDEN);  //显示倒计时按钮
    	}
        lv_label_set_text_fmt(countDownLabel, "%d", UP.compTime);  //更新时钟显示
    }
    /* 主温度显示 启停显示*/
    if (UP.regAddr100.Para.Run_State == 1)  //运行
    {
        lv_label_set_text_fmt(mainTempDisLabel, "#1085A8 %.1f#", UP.mainTempDisplay);  //更新显示主温度
        lv_label_set_recolor(mainTempDisLabel, true);  //启用标签文本重新着色

          lv_obj_add_state(runBtn, LV_STATE_CHECKED);
//        lv_obj_set_style_bg_color(runBtn,lv_palette_main(LV_PALETTE_BLUE),LV_STATE_DEFAULT);
//        lv_label_set_text(runBtnLabel, dispText[DA.typeLanguage].stop);  //启停按钮文本内容
//        lv_img_set_src(run_img, &dsc_ico_buff[8]);
    }
    else  //停止
    {
        lv_label_set_text_fmt(mainTempDisLabel, "#FFFFFF %.1f#", UP.mainTempDisplay);  //更新显示主温度
        lv_label_set_recolor(mainTempDisLabel, true);  //启用标签文本重新着色

        lv_obj_clear_state(runBtn, LV_STATE_CHECKED);
//        lv_obj_set_style_bg_color(runBtn, lv_palette_main(LV_PALETTE_ORANGE), LV_STATE_DEFAULT);
//        lv_label_set_text(runBtnLabel, dispText[DA.typeLanguage].run);  //启停按钮文本内容
//        lv_img_set_src(run_img, &dsc_ico_buff[7]);
    }

    /* 主温度、设置温度单位显示 */
    if (UP.Unit_Temp == 0)
    {
        lv_label_set_text(mainTempDispUnitLabel, "℃");  //主温度显示单位
        lv_label_set_text(mainTempSetUnitLabel, "℃");  //主温度设置单位
    }
    else
    {
        lv_label_set_text(mainTempDispUnitLabel, "℉");  //主温度显示单位
        lv_label_set_text(mainTempSetUnitLabel, "℉");  //主温度设置单位
    }
    /* 报警消息数量 */
    if (UP.gAlaFlag_Num != 0)
    {
        lv_label_set_text_fmt(messSumLabel, "%d", UP.gAlaFlag_Num);  //更新报警消息数量
    	if(lv_obj_has_flag(messSumLabel, LV_OBJ_FLAG_HIDDEN) == true)  //没有显示
    	{
    		lv_obj_clear_flag(messSumLabel, LV_OBJ_FLAG_HIDDEN);  //显示报警消息数量
    	}
    }
    else
    {
    	if(lv_obj_has_flag(messSumLabel, LV_OBJ_FLAG_HIDDEN) == false)  //没有隐藏
    	{
    		lv_obj_add_flag(messSumLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏报警消息数量
    	}
    }
    /* 程序控温 */
    if (UP.ES_ProTempCtrl == 1)
    {
    	if(lv_obj_has_flag(controlNumberLabel, LV_OBJ_FLAG_HIDDEN) == true)  //没有显示
    	{
    		lv_obj_clear_flag(controlNumberLabel, LV_OBJ_FLAG_HIDDEN);  //显示程序控温序号标签
    	}
        lv_label_set_text(controlNumberLabel, dispText[DA.typeLanguage].num);  //文本内容
    }
    else
    {
    	if(lv_obj_has_flag(controlNumberLabel, LV_OBJ_FLAG_HIDDEN) == false)  //没有隐藏
    	{
    		lv_obj_add_flag(controlNumberLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏程序控温序号标签
    	}
    }
    /* 内外循环切换 */
    if ((UP.Digital_Out1_Definition == 3) || (UP.Digital_Out2_Definition == 3))
    {
        if (UP.regAddr100.Para.Run_State == 1)  //设备运行
        {
            if (UP.regAddr100.Para.EQUWaterin == 0)
            {
                lv_label_set_text(inOutLabel, "#1085A8 IN#");  //内外循环切换图标
            }
            else
            {
                lv_label_set_text(inOutLabel, "#1085A8 OUT#");  //内外循环切换图标
            }
            lv_label_set_recolor(inOutLabel, true);  //启用标签文本重新着色
        	if(lv_obj_has_flag(inOutLabel, LV_OBJ_FLAG_HIDDEN) == true)  //没有显示
        	{
        		lv_obj_clear_flag(inOutLabel, LV_OBJ_FLAG_HIDDEN);  //显示程序控温序号标签
        	}
        }
        else
        {
        	if(lv_obj_has_flag(inOutLabel, LV_OBJ_FLAG_HIDDEN) == false)  //没有隐藏
        	{
        		lv_obj_add_flag(inOutLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏程序控温序号标签
        	}
        }
    }
    else
    {
    	if(lv_obj_has_flag(inOutLabel, LV_OBJ_FLAG_HIDDEN) == false)  //没有隐藏
    	{
    		lv_obj_add_flag(inOutLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏程序控温序号标签
    	}
    }
    /* 左下显示 */
    if (DA.leftValueFlag > 0)
    {
        if (DA.leftValueFlag == 1)  //实测流量
        {
            lv_label_set_text_fmt(leftValueLabel, "%.1f", UP.flowDisplay);  //更新左下显示值
            if(DA.leftValueFlag != lastLeft)
            {
				lv_label_set_text(leftIdLabel, "PV-F");  //更新左下显示标识标签
				if (UP.Unit_Flow == 0)
				{
					lv_label_set_text(leftUnitLabel, "LPM");  //更新左下显示单位标签
				}
				else if (UP.Unit_Flow == 1)
				{
					lv_label_set_text(leftUnitLabel, "TPH");  //更新左下显示单位标签
				}
            }
        }
        else if (DA.leftValueFlag == 2)  //出液压力
        {
            lv_label_set_text_fmt(leftValueLabel, "%d", (int)UP.outPressDisplay);  //更新左下显示值
            if(DA.leftValueFlag != lastLeft)
            {
				lv_label_set_text(leftIdLabel, "PV-P1");  //更新左下显示标识标签
				if (UP.Unit_Press == 0)
				{
					lv_label_set_text(leftUnitLabel, "kPa");  //更新左下显示单位标签
				}
				else if (UP.Unit_Press == 1)
				{
					lv_label_set_text(leftUnitLabel, "psi");  //更新左下显示单位标签
				}
            }
        }
        else if (DA.leftValueFlag == 3)  //辅助温度
        {
            lv_label_set_text_fmt(leftValueLabel, "%.1f", UP.subTempDisplay);  //更新左下显示值
            if(DA.leftValueFlag != lastLeft)
            {
				lv_label_set_text(leftIdLabel, "PV-T2");  //更新左下显示标识标签
				if (UP.Unit_Temp == 0)
				{
					lv_label_set_text(leftUnitLabel, "℃");  //更新左下显示单位标签
				}
				else if (UP.Unit_Temp == 1)
				{
					lv_label_set_text(leftUnitLabel, "℉");  //更新左下显示单位标签
				}
            }
        }
        else if (DA.leftValueFlag == 4)  //环境温度
        {
            lv_label_set_text_fmt(leftValueLabel, "%.1f", UP.ambTempDisplay);  //更新左下显示值
            if(DA.leftValueFlag != lastLeft)
            {
				lv_label_set_text(leftIdLabel, "PV-T3");  //更新左下显示标识标签
				if (UP.Unit_Temp == 0)
				{
					lv_label_set_text(leftUnitLabel, "℃");  //更新左下显示单位标签
				}
				else if (UP.Unit_Temp == 1)
				{
					lv_label_set_text(leftUnitLabel, "℉");  //更新左下显示单位标签
				}
            }
        }
        else if (DA.leftValueFlag == 5)  //实测水质
        {
            lv_label_set_text_fmt(leftValueLabel, "%.1f", UP.gPV_DI);  //更新左下显示值
            if(DA.leftValueFlag != lastLeft)
            {
				lv_label_set_text(leftIdLabel, "PV-W");  //更新左下显示标识标签
				lv_label_set_text(leftUnitLabel, "MΩ·cm");  //更新左下显示单位标签
            }
        }

       	if(lv_obj_has_flag(leftValueLabel, LV_OBJ_FLAG_HIDDEN) == true)  //没有显示
		{
       		lv_obj_clear_flag(leftValueLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏左下显示值标签
		}
		if(lv_obj_has_flag(leftIdLabel, LV_OBJ_FLAG_HIDDEN) == true)  //没有显示
		{
			lv_obj_clear_flag(leftIdLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏左下显示单位标签
		}
		if(lv_obj_has_flag(leftUnitLabel, LV_OBJ_FLAG_HIDDEN) == true)  //没有显示
		{
			lv_obj_clear_flag(leftUnitLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏左下显示标识标签
		}
    }
    else  //空
    {
    	if(lv_obj_has_flag(leftValueLabel, LV_OBJ_FLAG_HIDDEN) == false)  //没有隐藏
    	{
    		lv_obj_add_flag(leftValueLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏左下显示值标签
    	}
    	if(lv_obj_has_flag(leftIdLabel, LV_OBJ_FLAG_HIDDEN) == false)  //没有隐藏
    	{
    		lv_obj_add_flag(leftIdLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏左下显示单位标签
    	}
    	if(lv_obj_has_flag(leftUnitLabel, LV_OBJ_FLAG_HIDDEN) == false)  //没有隐藏
    	{
    		lv_obj_add_flag(leftUnitLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏左下显示标识标签
    	}
    }
    lastLeft = DA.leftValueFlag;

    /* 右下显示 */
    if (DA.rightValueFlag > 0)
    {
        if (DA.rightValueFlag == 1)  //回液压力
        {
            lv_label_set_text_fmt(rightValueLabel, "%d", (int)UP.inPressDisplay);  //更新右下显示值
            if(DA.rightValueFlag != lastRight)
            {
				lv_label_set_text(rightIdLabel, "PV-P2");  //更新右下显示标识标签
				if (UP.Unit_Press == 0)
				{
					lv_label_set_text(rightUnitLabel, "kPa");  //更新右下显示单位标签
				}
				else if (UP.Unit_Press == 1)
				{
					lv_label_set_text(rightUnitLabel, "psi");  //更新右下显示单位标签
				}
            }
        }
        else if (DA.rightValueFlag == 2)  //出液压力
        {
            lv_label_set_text_fmt(rightValueLabel, "%.0f", UP.outPressDisplay);  //更新右下显示值
            if(DA.rightValueFlag != lastRight)
            {
				lv_label_set_text(rightIdLabel, "PV-P1");  //更新右下显示标识标签
				if (UP.Unit_Press == 0)
				{
					lv_label_set_text(rightUnitLabel, "kPa");  //更新右下显示单位标签
				}
				else if (UP.Unit_Press == 1)
				{
					lv_label_set_text(rightUnitLabel, "psi");  //更新右下显示单位标签
				}
            }
        }
        else if (DA.rightValueFlag == 3)  //辅助温度
        {
            lv_label_set_text_fmt(rightValueLabel, "%.1f", UP.subTempDisplay);  //更新右下显示值
            if(DA.rightValueFlag != lastRight)
            {
				lv_label_set_text(rightIdLabel, "PV-T2");  //更新右下显示标识标签
				if (UP.Unit_Temp == 0)
				{
					lv_label_set_text(rightUnitLabel, "℃");  //更新右下显示单位标签
				}
				else if (UP.Unit_Temp == 1)
				{
					lv_label_set_text(rightUnitLabel, "°F");  //更新右下显示单位标签
				}
            }
        }
        else if (DA.rightValueFlag == 4)  //设定流量
        {
            lv_label_set_text_fmt(rightValueLabel, "%.1f", UP.SV_Flow);  //更新右下显示值
            if(DA.rightValueFlag != lastRight)
            {
				lv_label_set_text(rightIdLabel, "SV-F");  //更新右下显示标识标签
				if (UP.Unit_Flow == 0)
				{
					lv_label_set_text(rightUnitLabel, "LPM");  //更新右下显示单位标签
				}
				else if (UP.Unit_Flow == 1)
				{
					lv_label_set_text(rightUnitLabel, "TPH");  //更新右下显示单位标签
				}
            }
        }
        else if (DA.rightValueFlag == 5)  //设定压力
        {
            lv_label_set_text_fmt(rightValueLabel, "%.0f", UP.SV_Press);  //更新右下显示值
            if(DA.rightValueFlag != lastRight)
            {
				lv_label_set_text(rightIdLabel, "SV-P1");  //更新右下显示标识标签
				if (UP.Unit_Press == 0)
				{
					lv_label_set_text(rightUnitLabel, "kPa");  //更新右下显示单位标签
				}
				else if (UP.Unit_Press == 1)
				{
					lv_label_set_text(rightUnitLabel, "psi");  //更新右下显示单位标签
				}
            }
        }

        lastRight = DA.rightValueFlag;

       	if(lv_obj_has_flag(rightValueLabel, LV_OBJ_FLAG_HIDDEN) == true)  //没有显示
		{
       		lv_obj_clear_flag(rightValueLabel, LV_OBJ_FLAG_HIDDEN);  //显示右下显示值标签
		}
       	if(lv_obj_has_flag(rightUnitLabel, LV_OBJ_FLAG_HIDDEN) == true)  //没有显示
		{
       		lv_obj_clear_flag(rightUnitLabel, LV_OBJ_FLAG_HIDDEN);  //显示右下显示单位标签
		}
       	if(lv_obj_has_flag(rightIdLabel, LV_OBJ_FLAG_HIDDEN) == true)  //没有显示
		{
       		lv_obj_clear_flag(rightIdLabel, LV_OBJ_FLAG_HIDDEN);  //显示右下显示标识标签
		}
    }
    else  //空
    {
       	if(lv_obj_has_flag(rightValueLabel, LV_OBJ_FLAG_HIDDEN) == false)  //没有隐藏
		{
       		lv_obj_add_flag(rightValueLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏右下显示值标签
		}
       	if(lv_obj_has_flag(rightUnitLabel, LV_OBJ_FLAG_HIDDEN) == false)  //没有隐藏
		{
       		lv_obj_add_flag(rightUnitLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏右下显示单位标签
		}
       	if(lv_obj_has_flag(rightIdLabel, LV_OBJ_FLAG_HIDDEN) == false)  //没有隐藏
		{
       		lv_obj_add_flag(rightIdLabel, LV_OBJ_FLAG_HIDDEN);  //隐藏右下显示标识标签
		}
    }

}





